package cn.yyh.serviceOrg.config;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 杨永航
 * @version 1.0
 * @Title: WebMvcConfig
 * @Package: cn.yyh.basic.config
 * @date 2021/7/2
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Autowired
    private LoginInterceptor loginInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns(
                        "/serviceOrg/login/**",
                        "/serviceOrg/shop/register",
                        "/serviceOrg/user/phone/register",
//                        "/serviceOrg/user/getByLoginInfoId/**",
                        "/serviceOrg/verifyCode/**",
                        "/serviceOrg/mail/**",
                        "/serviceOrg/notify/**",
                        "/servicePet/**",
                        "/serviceOrder/**",
                        "/servicePay/**",
                        "/serviceOrg/fastDfs/**",
                        "/serviceOrg/fastDfs/upload/"
                        )
                .excludePathPatterns("/swagger-resources/**","/webjars/**","/v2/**","/swagger-ui.html/**");
        WebMvcConfigurer.super.addInterceptors(registry);
    }
}


